package com.mask.socket;

import java.io.IOException;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

/**
 * ClassName Test
 * Create by hx
 * Date 2021/9/17 2:11 下午
 */

public class Test {
    public static void main(String[] args) throws IOException {
        try (
            var s = new Socket("www.massz.edu.cn", 80);
            var in = new Scanner(s.getInputStream(), StandardCharsets.UTF_8);
        ) {
            while (in.hasNext()){
                String str = in.nextLine();
                System.out.println(str);
            }
        }
    }
}
